<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>供应商产品列表</title>
		<link rel="stylesheet" href="__PEAR__/component/pear/css/pear.css" />
		<style>
		.layui-input{width:250px;}
		.layui-form-label{width:auto;}
		.layui-form-item .layui-input-inline{width: 250px;}
		</style>
	</head>
	<body class="pear-container">
		<div class="layui-card">
			<div class="layui-card-body">
				<table id="product-table" lay-filter="product-table"></table>
			</div>
		</div>


		<script src="__STATIC__/lib/layui/layui.js"></script>
		<script src="__PEAR__/component/pear/pear.js"></script>
		<script>
			layui.use(['table', 'form', 'jquery','common'], function() {
				let table = layui.table;
				let form = layui.form;
				let $ = layui.jquery;
				let common = layui.common;

				let MODULE_PATH = "/{$MODULE_NAME}/Supcust/";

				let cols = [
					[	
						{
							title: '商品编码',
							field: 'item_no',
							align: 'center',
							width: 200
						},
						{
							title: '商品名称',
							field: 'item_name',
							align: 'center',
							width: 200
						},
						{
							title: '简称',
							field: 'item_subname',
							align: 'center',
							width: 200
						},
						{
							title: '产地',
							field: 'product_area',
							align: 'center'
						},
						{
							title: '单位',
							field: 'unit_no',
							align: 'center'
						},
						{
							title: '规格',
							field: 'item_size',
							align: 'center'
						},
						{
							title: '进价',
							field: 'price',
							align: 'center'
						},
						{
							title: '售价',
							field: 'sale_price',
							align: 'center'
						}
					]
				]

				table.render({
					elem: '#product-table',
					url: MODULE_PATH+"prodata/sp_no/{$sp_no}",
					page: true,
					cols: cols,
					skin: 'line',
					toolbar: '#product-toolbar',
					defaultToolbar: []
				});
				
				window.refresh = function(param) {
					table.reload('product-table');
				}
			})
		</script>
	</body>
</html>
